/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "cex_examen_fisico")
@NamedQueries({
    @NamedQuery(name = "CexExamenFisico.findAll", query = "SELECT c FROM CexExamenFisico c")})
public class CexExamenFisico implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "cfc_id")
    private Integer cfcId;
    @Column(name = "cfc_tipo")
    private Integer cfcTipo;
    @Size(max = 2147483647)
    @Column(name = "cfc_observacion")
    private String cfcObservacion;
    @JoinColumn(name = "cef_id", referencedColumnName = "cef_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private CexFisicoRegional cexFisicoRegional;
    @JoinColumn(name = "cco_id", referencedColumnName = "cco_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private CexConsulta cexConsulta;
    @Transient
    private List<CexExamenFisico> listaHijos;

    public CexExamenFisico() {
    }

    public CexExamenFisico(Integer cfcId) {
        this.cfcId = cfcId;
    }

    public Integer getCfcId() {
        return cfcId;
    }

    public void setCfcId(Integer cfcId) {
        this.cfcId = cfcId;
    }

    public Integer getCfcTipo() {
        return cfcTipo;
    }

    public void setCfcTipo(Integer cfcTipo) {
        this.cfcTipo = cfcTipo;
    }

    public String getCfcObservacion() {
        return cfcObservacion;
    }

    public void setCfcObservacion(String cfcObservacion) {
        this.cfcObservacion = cfcObservacion;
    }

    public CexFisicoRegional getCexFisicoRegional() {
        return cexFisicoRegional;
    }

    public void setCexFisicoRegional(CexFisicoRegional cexFisicoRegional) {
        this.cexFisicoRegional = cexFisicoRegional;
    }

    public CexConsulta getCexConsulta() {
        return cexConsulta;
    }

    public void setCexConsulta(CexConsulta cexConsulta) {
        this.cexConsulta = cexConsulta;
    }

    public List<CexExamenFisico> getListaHijos() {
        return listaHijos;
    }

    public void setListaHijos(List<CexExamenFisico> listaHijos) {
        this.listaHijos = listaHijos;
    }

   
    
    

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cfcId != null ? cfcId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CexExamenFisico)) {
            return false;
        }
        CexExamenFisico other = (CexExamenFisico) object;
        if ((this.cfcId == null && other.cfcId != null) || (this.cfcId != null && !this.cfcId.equals(other.cfcId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.CexExamenFisico[ cfcId=" + cfcId + " ]";
    }
    
}
